import {
	ref
} from 'vue'
import {
	defineStore
} from 'pinia'

export const useConsultStore = defineStore(
	'consult',
	() => {
		const initalValue = ref({
			illnessTimes: 1,
			illnessHistory: 1,
			consultFlag: '',
			pictures: []

		})

		// 患者病情数据
		const illnessINFO = ref({
			...initalValue.value
		})
		
		// 定义地址相关数据
		const type = ref('')
		const illnessType = ref('')
		const depId = ref('')
		const patientId = ref('')
		
		return {
			initalValue,
			illnessINFO,
			type,
			illnessType,
			depId,
			patientId,
		}

	}, {
		persist: {
			paths: ['illnessINFO', 'type', 'illnessType', 'depId', 'patientId']
		}
	}
)